-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Test rewrites #9037
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test rewrites #9037
Conversation
@@ -197,7 +197,6 @@ object Scanners { | |||
val noindentSyntax = | |||
ctx.settings.noindent.value | |||
|| ctx.settings.oldSyntax.value | |||
|| migrateTo3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think having -source 3.0-migrate
imply -noindent
is intentional: it should allow existing weirdly formatted scala 2 code to compile /cc @odersky.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue is that if a user run compiler with -rewrite
, then it's impossible to compile the code again.
It's discovered when we actually compile the rewritten code in the following test:
compileFile("tests/rewrites/rewrites.scala", scala2CompatMode.and("-rewrite", "-indent"))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that example I think -indent
needs to take precedence over migrateTo3
and force indentation to be on.
The code might have been rewritten with `-indent`, but still needs to compile in scala2compat mode.
@smarter Could you have a look at the changes again? |
Test rewrites to avoid accidental regression
Related: #9002 #8982